<template>
	<view class="search">
		<view class="t5">
			<view class="t6" v-for="item in list" @click="todetail(item.id)">
				<image :src="'http://124.93.196.45:10001'+item.imgUrl"></image>
				<view class="t7">
					<text>{{item.name}}</text>
					<view class="t8">
						<text>评分：{{item.score}}</text>
						<text style="margin-left: 30px;">月销量：{{item.saleQuantity}}单</text>
					</view>
					<text>人均消费：{{item.avgCost}}元</text>
					<text>到店距离：{{item.distance}}米</text>
					<text>到店时间：{{item.deliveryTime}}分钟</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[],
				name:''
			}
		},
		onLoad(options) {
			this.name=options.name
			this.getlist()
		},
		methods: {
			getlist(){
				this.api.get('/prod-api/api/takeout/seller/list?name='+this.name).then(res=>{
					this.list=res.data.rows
				})
			},
			todetail(id){
				uni.navigateTo({
					url:'/pages/other/takaway/takeawayDetail/takeawayDetail?id='+id
				})
			}
		}
	}
</script>

<style lang="scss">
.t5{
	.t6{
		display: flex;
		line-height: 30px;
		border-top: 1px solid salmon;
		margin-top: 20px;
		image{
			width: 125px;
			height: 125px;
			border-radius: 15px;
			margin-top: 15px;
		}
		.t7{
			margin-left: 15px;
			display: flex;
			flex-direction: column;
			.t8{
				display: flex;
				justify-content: space-between;
			}
		}
	}
}
</style>
